package com.yubest.designpattern.create.builder;

/**
 * 建造者
 *
 * @Author: hweiyu
 * @Date: 2022/10/26 12:03
 */
public class PersonBuilder {

    private String name;

    private Integer age;

    private String sex;

    public PersonBuilder name(String name) {
        this.name = name;
        return this;
    }

    public PersonBuilder age(Integer age) {
        this.age = age;
        return this;
    }

    public PersonBuilder sex(String sex) {
        this.sex = sex;
        return this;
    }

    public Person build() {
        return new Person(name, age, sex);
    }
}
